package InformationRetriever.ComparerMethod;

import Jama.Matrix;

public class InnerProductComparer extends ComparerBase
{    
    public double PerformCompare(int doc1, int doc2)
    {
        Matrix v = this.getV();
        if(v == null) 
            return 0;
        double innerProduct = 0;
        for(int i = 0; i < v.getRowDimension(); i++)
            innerProduct += v.get(i,doc1) * v.get(i,doc2);
        return innerProduct;
    }
}
